package com.cmcc.aregister.ui.dialog;

import java.util.List;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.cmcc.aregister.R;
import com.cmcc.aregister.cs.constant.HelpInc;
import com.cmcc.aregister.cs.model.Schedule;
import com.cmcc.aregister.ui.adapter.ChoiceTimeAdapter;

public class QuickYuyueTimeDlg extends Dialog {
    ListView list;
    List<Schedule> schList;
    Context context;
    HelpInc inc;

    public QuickYuyueTimeDlg(Context context, List<Schedule> mastList,
        HelpInc inc) {
        super(context);
        this.schList = mastList;
        this.context = context;
        this.inc = inc;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle(context.getString(R.string.choice_time));
        setContentView(R.layout.quick_yuyue);
        list = (ListView) findViewById(R.id.list);
        ChoiceTimeAdapter adapter = new ChoiceTimeAdapter(context, schList, "");
        list.setAdapter(adapter);
        list.setOnItemClickListener(mOnItemClickListener);
    }

    OnItemClickListener mOnItemClickListener = new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view,
            int position, long id) {
            // String schedule_id = schList.get(position).schedule_id;
            inc.notifyUI(position);
        }
    };

}